package com.tianjs.publish;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Service;

import com.tianjs.event.UserRegisterEvent;

import lombok.extern.slf4j.Slf4j;
@Slf4j
@Service
public class UserServiceImpl implements IUserService{

	@Autowired
	private ApplicationEventPublisher publisher;
	
	public void register(String username) {
		log.info("用户"+username+"已注册");
		publisher.publishEvent(new UserRegisterEvent(username));
	}

}
